package 方法;

import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
import java.util.Scanner;

public class 方法的定义_调用 {
    public static void main(String[] args) {
        Scanner scanner =new Scanner(System.in);
        System.out.print("请输入两个整数用空格隔开:");
        int max = CompareTheSize(scanner.nextInt(),scanner.nextInt());
        if (max==0){
            System.out.println("两个数相等");
        }else {
            System.out.println("最大的数为："+ max);
        }
        scanner.close();
    }
    /**
     * 定义方法：比较两个数的大小
     */
    public static int CompareTheSize(int x,int y){
        if (x==y){
            return 0;
        }else if (x>y){
            return x;
        }else {
            return y;
        }
    }
}
